import static java.lang.Math.*;//导包  *号是全能的意思

public class Test {
    public static void main(String[] args) {
        double i = 30;
        double j = 40;
        //double result = Math.sqrt(Math.pow(30,2) + Math.pow(40,2));
        double result = sqrt(pow(30,2) + pow(40,2));
        System.out.println(result);
    }
    public static void main2(String[] args) {
        Mydate i = new Mydate(1);
       //System.out.println(i.year);
        Mydate j = new Mydate(1900,12,1);

        System.out.println(j);
    }
    public static void main1(String[] args) {
        Mydemo1 i = new Mydemo1();
        i.var = 10;

        Mydemo1 j = new Mydemo1();
        j.var = 20;
        //System.out.println("交换前：" + i + j);没有引用只得出地址
        System.out.println("交换前：" + i.var + j.var);
        swap(i,j);
        System.out.println("交换后：" + i.var + j.var);

    }



    public static void swap(Mydemo1 a, Mydemo1 b){
        int k = a.var;
        a.var = b.var;
        b.var = k;
    }
}
